//
//  CocoaAfficheur.m
//  Metronome
//
//  Created by Pierre DUCHÊNE on 30/09/09.
//  Copyright 2009 GreenTeam. All rights reserved.
//

#import "CocoaAfficheur.h"


@implementation CocoaAfficheur

- (void)awakeFromNib
{
	imageAllume = [[NSImage imageNamed:@"allume.png"] retain];
	imageEteind = [[NSImage imageNamed:@"eteind.png"] retain];
}

#pragma mark -
#pragma mark Protocol Afficheur Methods
- (void)allumerLED:(NSUInteger)numLED
{
	switch (numLED) {
		case 1:
			[LED1 setImage:imageAllume];
			break;
		case 2:
			[LED2 setImage:imageAllume];
			break;
		default:
			NSLog(@"CocoaAfficheur: Numéro de LED invalid");
			break;
	}
}
- (void)eteindreLED:(NSUInteger)numLED
{
	switch (numLED) {
		case 1:
			[LED1 setImage:imageEteind];
			break;
		case 2:
			[LED2 setImage:imageEteind];
			break;
		default:
			NSLog(@"CocoaAfficheur: Numéro de LED invalid");
			break;
	}
}
- (void)afficherTempo:(NSUInteger)unTempo
{
	[ecranTempo setStringValue:[NSString stringWithFormat:@"%d",unTempo]];
}

- (void)afficherMesure:(NSInteger)uneMesure
{
	[ecranMesure setStringValue:[NSString stringWithFormat:@"%d",uneMesure]];
}

@end
